home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / cfirm1d.z / cfirm1d
Encoding:
Text File  |  2002-10-03  |  29.3 KB  |  595 lines

  1.  
  2.  
  3.  
  4. CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))                                                        CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      CCCCFFFFIIIIRRRRMMMM1111DDDD, ZZZZFFFFIIIIRRRRMMMM1111DDDD, SSSSFFFFIIIIRRRRMMMM1111DDDD, DDDDFFFFIIIIRRRRMMMM1111DDDD - Compute multiple 1D convolutions
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      Single precision complex
  13.  
  14.           Fortran:
  15.                CCCCAAAALLLLLLLL CCCCFFFFIIIIRRRRMMMM1111DDDD ((((_x,,,, _i_n_c_x,,,, _l_d_x,,,, _i_x_0,,,, _n_x,,,, _n_s_e_q,,,, _h,,,, _i_n_c_h,,,, _i_h_0,,,, _n_h,,,, _y,,,,
  16.                _i_n_c_y,,,, _l_d_y,,,, _i_y_0,,,, _n_y,,,, _a_l_p_h_a,,,, _b_e_t_a))))
  17.  
  18.           C/C++:
  19.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  20.                vvvvooooiiiidddd ccccffffiiiirrrrmmmm1111dddd(((( ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _i_x_0,,,, iiiinnnntttt _n_x,,,,
  21.                ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _i_h_0,,,, iiiinnnntttt _n_h,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_y,,,,
  22.                iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _i_y_0,,,, iiiinnnntttt _n_y,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_a_l_p_h_a,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx
  23.                *_b_e_t_a))));;;;
  24.  
  25.           C++ STL:
  26.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  27.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  28.                vvvvooooiiiidddd ccccffffiiiirrrrmmmm1111dddd(((( ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _i_x_0,,,, iiiinnnntttt _n_x,,,,
  29.                ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _i_h_0,,,, iiiinnnntttt _n_h,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>>
  30.                *_y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _i_y_0,,,, iiiinnnntttt _n_y,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_a_l_p_h_a,,,,
  31.                ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_b_e_t_a))))
  32.  
  33.      Double precision complex
  34.  
  35.           Fortran:
  36.                CCCCAAAALLLLLLLL ZZZZFFFFIIIIRRRRMMMM1111DDDD ((((_x,,,, _i_n_c_x,,,, _l_d_x,,,, _i_x_0,,,, _n_x,,,, _n_s_e_q,,,, _h,,,, _i_n_c_h,,,, _i_h_0,,,, _n_h,,,, _y,,,,
  37.                _i_n_c_y,,,, _l_d_y,,,, _i_y_0,,,, _n_y,,,, _a_l_p_h_a,,,, _b_e_t_a))))
  38.  
  39.           C/C++:
  40.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  41.                vvvvooooiiiidddd zzzzffffiiiirrrrmmmm1111dddd(((( ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _i_x_0,,,, iiiinnnntttt _n_x,,,,
  42.                ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _i_h_0,,,, iiiinnnntttt _n_h,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_y,,,,
  43.                iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _i_y_0,,,, iiiinnnntttt _n_y,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_a_l_p_h_a,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx
  44.                *_b_e_t_a))));;;;
  45.  
  46.           C++ STL:
  47.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  48.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  49.                vvvvooooiiiidddd zzzzffffiiiirrrrmmmm1111dddd(((( ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _i_x_0,,,, iiiinnnntttt _n_x,,,,
  50.                ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _i_h_0,,,, iiiinnnntttt _n_h,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>>
  51.                *_y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _i_y_0,,,, iiiinnnntttt _n_y,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_a_l_p_h_a,,,,
  52.                ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_b_e_t_a))));;;;
  53.  
  54.      Single precision
  55.  
  56.           Fortran:
  57.                CCCCAAAALLLLLLLL SSSSFFFFIIIIRRRRMMMM1111DDDD ((((_x,,,, _i_n_c_x,,,, _l_d_x,,,, _i_x_0,,,, _n_x,,,, _n_s_e_q,,,, _h,,,, _i_n_c_h,,,, _i_h_0,,,, _n_h,,,, _y,,,,
  58.                _i_n_c_y,,,, _l_d_y,,,, _i_y_0,,,, _n_y,,,, _a_l_p_h_a,,,, _b_e_t_a))))
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))                                                        CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))
  71.  
  72.  
  73.  
  74.           C/C++:
  75.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  76.                vvvvooooiiiidddd ssssffffiiiirrrrmmmm1111dddd(((( ffffllllooooaaaatttt *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _i_x_0,,,, iiiinnnntttt _n_x,,,, ffffllllooooaaaatttt *_h,,,,
  77.                iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _i_h_0,,,, iiiinnnntttt _n_h,,,, ffffllllooooaaaatttt *_y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _i_y_0,,,, iiiinnnntttt _n_y,,,,
  78.                ffffllllooooaaaatttt _a_l_p_h_a,,,, ffffllllooooaaaatttt _b_e_t_a))));;;;
  79.  
  80.      Double precision
  81.  
  82.           Fortran:
  83.                CCCCAAAALLLLLLLL DDDDFFFFIIIIRRRRMMMM1111DDDD ((((_x,,,, _i_n_c_x,,,, _l_d_x,,,, _i_x_0,,,, _n_x,,,, _n_s_e_q,,,, _h,,,, _i_n_c_h,,,, _i_h_0,,,, _n_h,,,, _y,,,,
  84.                _i_n_c_y,,,, _l_d_y,,,, _i_y_0,,,, _n_y,,,, _a_l_p_h_a,,,, _b_e_t_a))))
  85.  
  86.           C/C++:
  87.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  88.                vvvvooooiiiidddd ddddffffiiiirrrrmmmm1111dddd(((( ddddoooouuuubbbblllleeee *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _i_x_0,,,, iiiinnnntttt _n_x,,,, ddddoooouuuubbbblllleeee *_h,,,,
  89.                iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _i_h_0,,,, iiiinnnntttt _n_h,,,, ddddoooouuuubbbblllleeee *_y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _i_y_0,,,, iiiinnnntttt
  90.                _n_y,,,, ddddoooouuuubbbblllleeee _a_l_p_h_a,,,, ddddoooouuuubbbblllleeee _b_e_t_a))));;;;
  91.  
  92. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  93.      These routines are part of the SCSL Scientific Library and can be loaded
  94.      using either the ----llllssssccccssss or the ----llllssssccccssss____mmmmpppp option.  The ----llllssssccccssss____mmmmpppp option
  95.      directs the linker to use the multi-processor version of the library.
  96.  
  97.      When linking to SCSL with ----llllssssccccssss or ----llllssssccccssss____mmmmpppp, the default integer size is
  98.      4 bytes (32 bits). Another version of SCSL is available in which integers
  99.      are 8 bytes (64 bits).  This version allows the user access to larger
  100.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  101.      by using the ----llllssssccccssss____iiii8888 option or the ----llllssssccccssss____iiii8888____mmmmpppp option. A program may use
  102.      only one of the two versions; 4-byte integer and 8-byte integer library
  103.      calls cannot be mixed.
  104.  
  105.      The C and C++ prototypes shown above are appropriate for the 4-byte
  106.      integer version of SCSL. When using the 8-byte integer version, the
  107.      variables of type iiiinnnntttt become lllloooonnnngggg lllloooonnnngggg and the <<<<ssssccccssssllll____fffffffftttt____iiii8888....hhhh>>>> header
  108.      file should be included.
  109.  
  110. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  111.      These routines compute the convolutions of the filter vector _h with each
  112.      column of the two-dimenional array _x, producing the output two-
  113.      dimensional array _y:
  114.  
  115.           _y = beta * _y + alpha * _h * _x
  116.  
  117.      Suppose _h is a sequence of _n_h elements and _X is a 2D matrix with _n_s_e_q
  118.      columns, and _n_x elements in each column, as follows:
  119.  
  120.      h = [ h(0), h(1), , h(nh - 1) ] ,
  121.  
  122.                              and
  123.  
  124.            x(0, 0)     x(0, 1)     x(0, 2)      x(0, nseq-1)
  125.            x(1, 0)     x(1, 1)     x(1, 2)      x(1, nseq-1)
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))                                                        CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))
  137.  
  138.  
  139.  
  140.      X =   x(2, 0)     x(2, 1)     x(2, 2)      x(2, nseq-1)
  141.                    ...         ...         ...        ...  ...
  142.            x(nx-1, 0)  x(nx-1, 1)  x(nx-1, 2)   x(nx-1, nseq-1)
  143.  
  144.  
  145.      Then each column of the output matrix:
  146.  
  147.            y(0, 0)     y(0, 1)     y(0, 2)      y(0, nseq-1)
  148.            y(1, 0)     y(1, 1)     y(1, 2)      y(1, nseq-1)
  149.      Y =   y(2, 0)     y(2, 1)     y(2, 2)      y(2, nseq-1)
  150.                    ...         ...         ...        ...  ...
  151.            y(ny-1, 0)  y(ny-1, 1)  y(ny-1, 2)   y(ny-1, nseq-1)
  152.  
  153.  
  154.      is obtained by convolving _h with the corresponding column of so that:
  155.  
  156.              MIN(i, nh-1)
  157.      y(i,j)= Sum          {h(k)*x(i-k,j)}
  158.              k = MAX(0, i-nx+1)
  159.  
  160.              nh-1
  161.      y(i,j)= Sum          {h(k)*x(i-k,j)}
  162.              k=0
  163.                         0 <=_i<_n_x, 0<=_j<_n_s_e_q
  164.  
  165.  
  166.      That is:
  167.  
  168.           y(0,j)=h(0)*x(0,j)
  169.           y(1,j)=h(0)*x(1,j) + h(1)*x(0,j)
  170.           y(2,j)=h(0)*x(2,j) + h(1)*x(1,j)+h(2)*x(0,j)
  171.  
  172.           y(nh-1,j)=h(0)*x(nh-1,j) + h(1)*x(nh-2,j) + ... + h(nh-1)*x(0,j)
  173.                                            ...
  174.           y(k,j)=h(0)*x(k,j)+h(1)*x(k,j-1) + ... + h(nh-1)*x(k,j-nh+1)
  175.                                            ...
  176.           y(nx-1,j)=h(0)*x(nx-1,j) + h(1)*x(nx-2,j) + ... + h(nh-1)*x(nx-nh,j)
  177.                                            ...
  178.           y(nx+nh-3,j)=h(nh-2)*x(nx-1,j) + h(nh-1)*x(nx-2,j)
  179.           y(nx+nh-2,j)=h(nh-1)*x(nx-1,j)
  180.  
  181.  
  182.      In the ****FFFFIIIIRRRRMMMM1111DDDD routines, the number of terms in the each output column is
  183.      specified by an argument, _n_y.  If _n_y < _n_h + _n_x - 1 the columns of _y are
  184.      truncated.  If _n_y > _n_h + _n_x - 1 the terms beyond _y(_n_h + _n_x - 2) are set
  185.      to 0.
  186.  
  187.      Generally, the sequences _x(:,_j), _h and _y(:,_j) represent signals sampled
  188.      at equal time intervals, and the indexes of the vectors denote the sample
  189.      times.  If the signals begin at the same time, we may, without loss of
  190.      generality, set the initial time to 0, as in the formulas above.
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))                                                        CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))
  203.  
  204.  
  205.  
  206.      The ****FFFFIIIIRRRRMMMM1111DDDD routines, however, permit more generality than this. The
  207.      signals may be time shifted from each other using input parameters
  208.      specifiying the initial time sample for each signal. This can be useful
  209.      in several situations. For example, if the input array has several
  210.      leading zero values that one does not wish to store, iiiixxxx0000 may be set to
  211.      the time sample corresponding to the first non-zero element in the input
  212.      array, and earlier time samples are treated as 0. Another use is to limit
  213.      the output to just the "fully engaged" terms of the convolution.
  214.  
  215.      As can be seen above, when _n_x>= _n_h, the convolution has ramp-up and
  216.      ramp-down regions in which fewer than all _n_h filter values contribute to
  217.      the output value. Setting iiiiyyyy0000 to _n_h-1 causes the first value output to
  218.      correspond to time sample _n_h-1, thus skipping the ramp-up region.
  219.      Setting _n_y to _n_x-nh+1 then drops the ramp-down terms, limiting the output
  220.      to just the fully engaged part.
  221.  
  222.      Note that, instead of 0, the initial time could just as easily have been
  223.      labeled 1 or 10 or -78; the relevant point is that the first elements of
  224.      each of the _x, _h and _y arrays are defined to be the same time sample as
  225.      long as iiiixxxx0000 ==== iiiihhhh0000 ==== iiiiyyyy0000.
  226.  
  227.      See the NOTES section of this man page for information about the
  228.      interpretation of the data types described in the following arguments.
  229.  
  230.      These routines have the following arguments:
  231.  
  232.      _x         Array of dimension (_l_d_x, _n_s_e_q). (input).
  233.                CCCCFFFFIIIIRRRRMMMM1111DDDD: Single precision complex array.
  234.                ZZZZFFFFIIIIRRRRMMMM1111DDDD: Double precision complex array.
  235.                SSSSFFFFIIIIRRRRMMMM1111DDDD: Single precision array.
  236.                DDDDFFFFIIIIRRRRMMMM1111DDDD: Double precision array.
  237.                Input sequences to be correlated with _h.
  238.  
  239.      _i_n_c_x      Integer. (input)
  240.                Increment between two successive values of a sequence in _x.
  241.                _i_n_c_x must not be 0.
  242.  
  243.      _l_d_x       Integer. (input)
  244.                The number of rows in _x as it was declared in the calling
  245.                program (the leading dimension of _x).  _l_d_x >= MAX(_n_x  *
  246.                _i_n_c_x,1).
  247.  
  248.      _i_x_0       Integer. (input)
  249.                Time sample corresponding to the first element of each 1D
  250.                sequence of _x.
  251.  
  252.      _n_x        Integer. (input)
  253.                The number of elements in each sequence of _x.  _n_x >= 0.
  254.  
  255.      _n_s_e_q      Integer.  (input)
  256.                The number of sequences to which the convolution will be
  257.                applied. _n_s_e_q >= 0. If _n_s_e_q = 0, the routine returns.
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))                                                        CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))
  269.  
  270.  
  271.  
  272.      _h         Array of dimension _n_h. (input).
  273.                CCCCFFFFIIIIRRRRMMMM1111DDDD: Single precision complex array.
  274.                ZZZZFFFFIIIIRRRRMMMM1111DDDD: Double precision complex array.
  275.                SSSSFFFFIIIIRRRRMMMM1111DDDD: Single precision array.
  276.                DDDDFFFFIIIIRRRRMMMM1111DDDD: Double precision array.
  277.                Input sequence to be convoluted with _x.
  278.  
  279.      _i_n_c_h      Integer.  (input)
  280.                Increment between two successive values of _h. _i_n_c_h must not be
  281.                0.
  282.  
  283.      _i_h_0       Integer.  (input)
  284.                Time sample corresponding to the first element of _h.
  285.  
  286.      _n_h        Integer.  (input)
  287.                The number of elements in the sequence _h.  _n_h >= 0. If _n_h = 0,
  288.                the routine returns.
  289.  
  290.      _y         Array dimensioned (_l_d_y, _n_s_e_q).  (output)
  291.                CCCCFFFFIIIIRRRRMMMM1111DDDD: Single precision complex array.
  292.                ZZZZFFFFIIIIRRRRMMMM1111DDDD: Double precision complex array.
  293.                SSSSFFFFIIIIRRRRMMMM1111DDDD: Single precision array.
  294.                DDDDFFFFIIIIRRRRMMMM1111DDDD: Double precision array.
  295.                Output of the FIR filter.  On entry, the array _y must have been
  296.                initialized, except when _b_e_t_a is zero.  In that case, _y need
  297.                not be initialized.  On exit, the result overwrites _y.
  298.  
  299.      _i_n_c_y      Integer.  (input)
  300.                Increment between two successive values of a sequence in _y.
  301.                _i_n_c_y must not be 0.
  302.  
  303.      _l_d_y       Integer.  (input)
  304.                The number of rows in _y as it was declared in the calling
  305.                program (the leading dimension of _y). _l_d_y >= MAX(_n_y * _i_n_c_y, 1).
  306.  
  307.      _i_y_0       Integer.  (input)
  308.                Time sample corresponding to the first element of each 1D
  309.                sequence of _y.
  310.  
  311.      _n_y        Integer.  (input)
  312.                Number of elements in each sequence of _y.  _n_y >= 0. If _n_y = 0,
  313.                the routine returns.
  314.  
  315.      _a_l_p_h_a     Scale factor for the convolution.  (input).
  316.                CCCCFFFFIIIIRRRRMMMM1111DDDD: Single precision complex.
  317.                ZZZZFFFFIIIIRRRRMMMM1111DDDD: Double precision complex.
  318.                SSSSFFFFIIIIRRRRMMMM1111DDDD: Single precision.
  319.                DDDDFFFFIIIIRRRRMMMM1111DDDD: Double precision.
  320.                For C/C++, a pointer to this value is passed.
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))                                                        CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))
  335.  
  336.  
  337.  
  338.      _b_e_t_a      Scale factor for the output _y. (input)
  339.                CCCCFFFFIIIIRRRRMMMM1111DDDD: Single precision complex.
  340.                ZZZZFFFFIIIIRRRRMMMM1111DDDD: Double precision complex.
  341.                SSSSFFFFIIIIRRRRMMMM1111DDDD: Single precision.
  342.                DDDDFFFFIIIIRRRRMMMM1111DDDD: Double precision.
  343.                When _b_e_t_a is supplied as 0, _y need not be set on input.  For
  344.                C/C++, a pointer to this value is passed.
  345.  
  346. NNNNOOOOTTTTEEEESSSS
  347.      The following data types are described in this documentation:
  348.  
  349.           TTTTeeeerrrrmmmm UUUUsssseeeedddd                     DDDDaaaattttaaaa ttttyyyyppppeeee
  350.  
  351.      Fortran:
  352.  
  353.           Array dimensioned 0000........_n----1111      xxxx((((0000::::nnnn----1111))))
  354.  
  355.           Array of dimensions (_m,_n)     xxxx((((mmmm,,,,nnnn))))
  356.  
  357.           Array of dimensions (_m,_n,_p)   xxxx((((mmmm,,,,nnnn,,,,pppp))))
  358.  
  359.           IIIInnnntttteeeeggggeeeerrrr                       IIIINNNNTTTTEEEEGGGGEEEERRRR (IIIINNNNTTTTEEEEGGGGEEEERRRR****8888 for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  360.  
  361.           Single precision              RRRREEEEAAAALLLL
  362.  
  363.           Double precision              DDDDOOOOUUUUBBBBLLLLEEEE PPPPRRRREEEECCCCIIIISSSSIIIIOOOONNNN
  364.  
  365.           Single precision complex      CCCCOOOOMMMMPPPPLLLLEEEEXXXX
  366.  
  367.           Double precision complex      DDDDOOOOUUUUBBBBLLLLEEEE CCCCOOOOMMMMPPPPLLLLEEEEXXXX
  368.  
  369.      C/C++:
  370.  
  371.           Array dimensioned 0000........_n----1111      xxxx[[[[_n]]]]
  372.  
  373.           Array of dimensions (_m,_n)     xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]]
  374.  
  375.           Array of dimensions (_m,_n,_p)   xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]]
  376.  
  377.           IIIInnnntttteeeeggggeeeerrrr                       iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  378.  
  379.           Single precision              ffffllllooooaaaatttt
  380.  
  381.           Double precision              ddddoooouuuubbbblllleeee
  382.  
  383.           Single precision complex      ssssccccssssllll____ccccoooommmmpppplllleeeexxxx
  384.  
  385.           Double precision complex      ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx
  386.  
  387.      C++ STL:
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))                                                        CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))
  401.  
  402.  
  403.  
  404.           Array dimensioned 0000........_n----1111      xxxx[[[[_n]]]]
  405.  
  406.           Array of dimensions (_m,_n)     xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]]
  407.  
  408.           Array of dimensions (_m,_n,_p)   xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]]
  409.  
  410.           IIIInnnntttteeeeggggeeeerrrr                       iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  411.  
  412.           Single precision              ffffllllooooaaaatttt
  413.  
  414.           Double precision              ddddoooouuuubbbblllleeee
  415.  
  416.           Single precision complex      ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>>
  417.  
  418.           Double precision complex      ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>>
  419.  
  420. CCCCAAAAUUUUTTTTIIIIOOOONNNNSSSS
  421.      The arrays _x, _h, and _y must be non-overlapping.
  422.  
  423. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  424.      The following example computes the convolution of 5 4-sample sequences _x
  425.      with a filter _h containing 3 samples:
  426.  
  427.      Fortran:
  428.  
  429.            REAL X(0:3,0:4), H(0:2), Y(0:5,0:4)
  430.            REAL ALPHA, BETA
  431.            ALPHA = 1.0
  432.            BETA  = 0.0
  433.  
  434.            DO J = 0, 4
  435.               X(0,J) = J + 1.0
  436.                 DO I = 1, 3
  437.                    X(I,J) = -1.0 - j
  438.                 ENDDO
  439.            ENDDO
  440.            DO I = 0, 2
  441.              H(I) = 1.0/(I+1)
  442.            ENDDO
  443.            CALL SFIRM1D(X(0,0), 1, 4, 0, 4, 5, H(0), 1, 0, 3,
  444.           &             Y(0,0), 1, 6, 0, 6, ALPHA, BETA)
  445.  
  446.  
  447.      C/C++:
  448.  
  449.           #include <scsl_fft.h>
  450.           float x[5][4], h[3], y[5][6];
  451.           float alpha = 1.0f;
  452.           float beat  = 0.0f;
  453.           int i, j;
  454.  
  455.           for (j=0; j<5; j++) {
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))                                                        CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))
  467.  
  468.  
  469.  
  470.             x[j][0] = j + 1.0f;
  471.                for (i=1; i<4; i++) {
  472.                    x[j][i] = -1.0f - j;
  473.                }
  474.           }
  475.           for (i=0; i<3; i++) {
  476.             h[i] = 1.0f/(i+1);
  477.           }
  478.           sfirm1d((float *) x, 1, 4, 0, 4, 5, h, 1, 0, 3,
  479.                   (float *) y, 1, 6, 0, 6, alpha, beta);
  480.  
  481.  
  482.      The output is
  483.  
  484.                       Y(:,0)   Y(:,1)   Y(:,2)   Y(:,3)   Y(:,4)
  485.           Y(0,:)      1.0000   2.0000   3.0000   4.0000   5.0000
  486.           Y(1,:)     -0.5000  -1.0000  -1.5000  -2.0000  -2.5000
  487.           Y(2,:)     -1.1667  -2.3333  -3.5000  -4.6667  -5.8333
  488.           Y(3,:)     -1.8333  -3.6667  -5.5000  -7.3333  -9.1667
  489.           Y(4,:)     -0.8333  -1.6667  -2.5000  -3.3333  -4.1667
  490.           Y(5,:)     -0.3333  -0.6667  -1.0000  -1.3333  -1.6667
  491.  
  492.  
  493.      Changing the values for ix0, ih0 and iy0 produces the following shifts in
  494.      the output:
  495.  
  496.           ix0 = +1    Y(:,0)   Y(:,1)   Y(:,2)   Y(:,3)   Y(:,4)
  497.           Y(0,:)      0.0000   0.0000   0.0000   0.0000   0.0000
  498.           Y(1,:)      1.0000   2.0000   3.0000   4.0000   5.0000
  499.           Y(2,:)     -0.5000  -1.0000  -1.5000  -2.0000  -2.5000
  500.           Y(3,:)     -1.1667  -2.3333  -3.5000  -4.6667  -5.8333
  501.           Y(4,:)     -1.8333  -3.6667  -5.5000  -7.3333  -9.1667
  502.           Y(5,:)     -0.8333  -1.6667  -2.5000  -3.3333  -4.1667
  503.  
  504.           ih0 = -1    Y(:,0)   Y(:,1)   Y(:,2)   Y(:,3)   Y(:,4)
  505.           Y(0,:)     -0.5000  -1.0000  -1.5000  -2.0000  -2.5000
  506.           Y(1,:)     -1.1667  -2.3333  -3.5000  -4.6667  -5.8333
  507.           Y(2,:)     -1.8333  -3.6667  -5.5000  -7.3333  -9.1667
  508.           Y(3,:)     -0.8333  -1.6667  -2.5000  -3.3333  -4.1667
  509.           Y(4,:)     -0.3333  -0.6667  -1.0000  -1.3333  -1.6667
  510.           Y(5,:)      0.0000   0.0000   0.0000   0.0000   0.0000
  511.  
  512.           iy0 = -1    Y(:,0)   Y(:,1)   Y(:,2)   Y(:,3)   Y(:,4)
  513.           Y(0,:)      0.0000   0.0000   0.0000   0.0000   0.0000
  514.           Y(1,:)      1.0000   2.0000   3.0000   4.0000   5.0000
  515.           Y(2,:)     -0.5000  -1.0000  -1.5000  -2.0000  -2.5000
  516.           Y(3,:)     -1.1667  -2.3333  -3.5000  -4.6667  -5.8333
  517.           Y(4,:)     -1.8333  -3.6667  -5.5000  -7.3333  -9.1667
  518.           Y(5,:)     -0.8333  -1.6667  -2.5000  -3.3333  -4.1667
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))                                                        CCCCFFFFIIIIRRRRMMMM1111DDDD((((3333SSSS))))
  533.  
  534.  
  535.  
  536. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  537.      CCCCCCCCOOOORRRR1111DDDD(3S), IIIINNNNTTTTRRRROOOO____FFFFFFFFTTTT(3S), IIIINNNNTTTTRRRROOOO____SSSSCCCCSSSSLLLL(3S
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.                                                                         PPPPaaaaggggeeee 9999
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.